package com.link.base.base.dept.dao.mybatis.mapper;

import com.link.base.base.dept.model.Department;
import com.link.base.base.dept.model.DepartmentRelation;
import com.link.core.basic.dao.mapper.BasicMapper;

import java.util.List;
/**
 * Copyright  hande Company. All Rights Reserved.
 *
 * @author  unknwon
 * @date:   2018/11/9 16:09
 * @version 1.0
 */

public interface DepartmentMapper extends BasicMapper<Department> {

    /**
     * 查询根部门
     *
     * @param entity
     * @return
     * @throws Exception
     */
    public Department queryRoot(Department entity) throws Exception;

    /**
     * 查询部门列表表排除主键为Id的部门和其子部门，只取有效的信息
     *
     * @param entity
     * @return
     * @throws Exception
     */
    public List<Department> queryDepartmentListRemoveIdAndChildrenPage(Department entity) throws Exception;

    /**
     * 获取部门其子部门
     * @param entity
     * @return
     * @throws Exception
     */
    public String getDeptChildStr(Department entity) throws Exception;

    /**
     * 获取多层级部门关联关系
     * @author 姚江漪
     * @date 2019/04/02 23:20
     * @param departmentRelation
     */
    public List<DepartmentRelation> queryAreaRegionPage(DepartmentRelation departmentRelation) throws Exception;

    /**
     * 能过部门获取上层级部门相应信息
     * @author 姚江漪
     * @date 2019/04/13 01:16
     * @param department
     */
    public List<Department> queryTierDept(Department department) throws Exception;
}
